4

I am new to LaTeX basically a perl developer,

I am trying to automate Bibliographies styles by providing separate tags for each and every fields like shown in the below, and also I am trying to create the output for that coding like I shown below, I am getting errors when a newline is inside bibitem and also creating extra space, how to rectify this updated Sample:

\documentclass{article}
\newcommand\JRNL[1]{#1}
\newcommand\AUGRP[1]{{#1}}
\newcommand\AUTHOR[1]{#1}
\newcommand\SNM[1]{#1}
\newcommand\INITS[1]{#1}
\newcommand\SEP[1]{#1}
\newcommand\ATITLE[1]{#1}
\newcommand\JTITLE[1]{{\em #1}}
\newcommand\VOLUME[1]{#1}
\newcommand\YEAR[1]{#1}
\newcommand\FPAGE[1]{#1}
\newcommand\LPAGE[1]{#1}

\begin{document}

\begin{thebibliography}{9}

\bibitem{bib1}
\JRNL{\AUGRP{\AUTHOR{\INITS{A.}\SEP{ }\SNM{Chorry}}\SEP{, }
\AUTHOR{\INITS{B.}\SEP{ }\SNM{Patkddds}}\SEP{, `}}
\ATITLE{intersections in spaces}\SEP{', }
\JTITLE{Ser. A}\SEP{ }
\VOLUME{117}\SEP{ (}
\YEAR{2010}\SEP{) }
\FPAGE{1095}\SEP{--}
\LPAGE{1106}\SEP{.}}

\end{thebibliography}

\end{document}

Output:

A. Chorry, B. Patkddds, `Intersections in spaces', Ser. A. 117 (2010), 1095--1106.

actual problem for me is, I just need to hide the space created by Latex inside bibitem after the single newline character, is it possible to Deactivate the automatic space created by latex after that single newline??, other style related things, i managed myself, for example:

\VOLUME{117}\SEP{ (}
\YEAR{2010}\SEP{) }

I don't want the automatic space generated by Latex after "("

My output is looking like this

A. Chorry, B. Patkddds, `Intersections in spaces', Ser. A. 117 ( 2010), 1095--1106.

Please guide me

Sathish V
  • 293
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – Marco Daniel Dec 13 '13 at 11:41
  • You should start using biblatex. Therefor you have to save your bibliography material inside a separate bib-file. Here at TeX.SX you will find a lot of examples. http://tex.stackexchange.com/questions/tagged/biblatex?sort=votes&pageSize=50 – Marco Daniel Dec 13 '13 at 11:42
  • My problem is i want to save the separators including SPACE in \SEP{} tag, so that i can reuse and automate it for the next process involved in that – Sathish V Dec 13 '13 at 11:44
  • 1
    Excuse me, but for me you are trying to develop a new bibliography tool. Maybe we can help you if we know your current definitions. So please provide a minimal working example. However I think you should also read the following article: Wikibooks LaTeX/Bibliography Management. As noted before the "new" tool biblatex is absolutely recommended. – Marco Daniel Dec 13 '13 at 12:25
  • @SatishV I'd follow Marco's advice. You can always create a custom style and layout that way, but bib files are considered standard. If you still need your version of the file for some management or third party/personal application reason, then I'd suggest looking at the standard bibtex format and converting that to your example above with perl. I'm sure this approach should save you a lot of time vs 'reinventing the wheel' – Forkrul Assail Dec 13 '13 at 12:26
  • Thanks for your suggestion, actual problem for me is, I just need to hide the space created by Latex inside bibitem after the single newline character, is it possible to Deactivate the automatic space created by latex after that single newline??, other style related things, i managed myself, for example "\SEP{', } \JTITLE{Ser. A}", i don't want the automatic space generated by Latex before \JTITLE{Ser. A} – Sathish V Dec 13 '13 at 12:32
  • 1
    I guess you are looking for something like this: What is the use of percent signs (%) at the end of lines?. BTW LaTeX doesn't provide such an \bibitem-output. Which tool do you use? – Marco Daniel Dec 13 '13 at 12:38
  • 1
    Without a MWE it is difficult to test, but you may want to end your lines with %. – StrongBad Dec 13 '13 at 12:39
  • @Marco Daniel, I am not using any tool for that, i am customizing it myself, Yeah but is it possible to do it Template or something like that??, i know that % option to hide space, but whether it is possible by defining my \SEP{} or \JTITLE{}? please guide – Sathish V Dec 13 '13 at 12:45
  • Please see: http://tex.stackexchange.com/questions/37030/how-can-i-avoid-whitespace-after-a-macro-which-takes-arguments/37035#37035 --\ignorespaces -- I hope it is what you want. – Marco Daniel Dec 13 '13 at 12:48

2 Answers2

1

I guess you want something that ignores a line break.

\begingroup
\endlinechar=-1 
Hallo
Welt
\endgroup

Hallo
Welt
\bye
Marco Daniel
  • 95,681
0

With the MWE the answer is clear: you need a % after \VOLUME{117}\SEP{ (}

\documentclass{article}
\newcommand\JRNL[1]{#1}
\newcommand\AUGRP[1]{{#1}}
\newcommand\AUTHOR[1]{#1}
\newcommand\SNM[1]{#1}
\newcommand\INITS[1]{#1}
\newcommand\SEP[1]{#1}
\newcommand\ATITLE[1]{#1}
\newcommand\JTITLE[1]{{\em #1}}
\newcommand\VOLUME[1]{#1}
\newcommand\YEAR[1]{#1}
\newcommand\FPAGE[1]{#1}
\newcommand\LPAGE[1]{#1}

\begin{document}

\begin{thebibliography}{9}

\bibitem{bib1}
\JRNL{\AUGRP{\AUTHOR{\INITS{A.}\SEP{ }\SNM{Chorry}}\SEP{, }
\AUTHOR{\INITS{B.}\SEP{ }\SNM{Patkddds}}\SEP{, `}}
\ATITLE{intersections in spaces}\SEP{', }
\JTITLE{Ser. A}\SEP{ }
\VOLUME{117}\SEP{ (}%
\YEAR{2010}\SEP{) }
\FPAGE{1095}\SEP{--}
\LPAGE{1106}\SEP{.}}

\end{thebibliography}

\end{document}

enter image description here

StrongBad
  • 20,495