2

I want to modify book, online and misc title. They are italic but it must be non-italic. I think, \APACrefbtitle (i found in .bbl file) is about this. I tried some alternatives on the %\patchcmd{\APACrefbtitle}{} %book, online, misc title line but i could not be successiful.

I think \patchcmd{\APACjournalVolNumPages}{\Bem}{\uline}{}{} line is about all of the journal, volume, number and pages. I only used this for deitalicize and underline the journal title. In additon, i want to deitalicize the volume number but i don't know how can i do this. A modify on this line is affect the journal, volume, number and page.

Thank you.

Image

main.tex

\documentclass[12pt]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[main=turkish,english,shorthands=:!]{babel}
\usepackage[a4paper,left=30mm,top=30mm,right=25mm,bottom=25mm]{geometry}
\usepackage{tocloft}
\usepackage{lipsum}
\usepackage{titlesec}


\usepackage{apacite}
\usepackage[normalem]{ulem}
\usepackage{etoolbox}





% BIBLIOGRAPHY
\AtBeginDocument{\urlstyle{APACsame}} % Same fonts for URL
%%% Bibliography line spacing
\usepackage{natbib}
\setlength{\bibsep}{0.0pt}
%%% Removing parentheses around year in bibliography
\AtBeginDocument{
\renewcommand{\BBOP}{}
\renewcommand{\BBCP}{}
\renewcommand{\BCBL}{}
\renewcommand{\BCBL}{}

\renewcommand{\BBAA}{ve}
%\renewcommand{\BBAB}{} %What is?
%\renewcommand{\BAnd}{} %What is?
\renewcommand{\BOthers}{vd}
}



\patchcmd{\APACjournalVolNumPages}{\Bem}{\uline}{}{}
%\patchcmd{\APACrefbtitle}{} %book, online, misc title  

%%% Adding ":" character before page number in citations
\bibpunct[: ]{(}{)}{:}{a}{,}{~}
%........................................






\usepackage[unicode]{hyperref} %son yükle



% BEGIN
\begin{document}

% CHAPTER 1
\chapter{GİRİŞ}
\citep{ferretti2001}, \citep{onlinedeneme}, \citet{frattini2013}, \citet{onlinedeneme}'e göre.
\lipsum[1-1]


% CHAPTER 2
% BIBLIOGRAPHY (Kaynaklar)
\renewcommand*\bibname{KAYNAKLAR}
\nocite{*} % Add all references within the .bib file
\phantomsection
\bibliographystyle{apacite}


\setlength{\bibsep}{1\itemsep}
\bibliography{literature}
\clearpage

\end{document}

literature.bib

@article{ferretti2001,
  title     = {Permanent Scatterers in SAR Interferometry},
  author    = {Alessandro Ferretti and Claudio Prati and Fabio Rocca},
  journal   = {IEEE Transactions on Geoscience and Remote Sensing},
  number    = {1},
  volume    = {39},
  pages     = {8--20},
  year      = {2001},
  publisher = {IEEE-INST Electrical Electronics Engineers Inc},
  doi       = {10.1109/36.898661},
}
@article{frattini2013,
  title     = {Damage to Buildings in Large Slope Rock Instabilities
Monitored with the PSInSAR™ Technique},
  author    = {Paolo Frattini and Giovanni B. Crosta and Jacopo Allievi},
  journal   = {Remote Sensing},
  volume    = {5},
  pages     = {4753--4773},
  year      = {2013},
  publisher = {MDPI AG},
  doi       = {10.3390/rs5104753}, 
}
@online{onlinedeneme,
  title     = {Deneme Başlığı},
  author    = {Yazar Zadı and Iyazar Isoyad},
  year      = {2009},
  url       = {http://www.nytimes.com/},
  urldate   = {28 Ocak 2018}
}
@book{pye2010trashculture,
  author    = {John Doe},
  publisher = {Book Company},
  series    = {Cultural Interactions},
  title     = {Cultures of Amazons},
  year      = {2015},
}
2

Your problem comes from a side effect between the normalem option of ulem package and the patchcmd. The command \APACjournalVolNumPages containt to calls to \Bem :

\meaning\APACjournalVolNumPages

prints:

\long macro:#1#2#3#4->\Bem {#1}\ifx \@empty #2\@empty \else \unskip , \Bem
{#2}\fi \ifx \@empty #3\@empty \else \unskip ({#3})\fi \ifx \@empty #4\@empty\else \unskip , {#4}\fi

with \Bem -> \protect\emph

Hence:

  • with \usepackage{ulem} all the \emph are silently replaced by \uline. Then, even WITHOUT the \patchcmd you get: enter image description here
  • With \usepackage[normalem]{ulem}, followed by:

\patchcmd{\APACjournalVolNumPages}{\Bem}{\uline}{\typeout{patch success}}{\typeout{patch failed}}

only the first \Bem is replaced by \uline (i don't know why) and you get the unwanted result: enter image description here

The solution is as follows:

  • either do not use the normalem option, but all the \emph will become underlined.
  • or keep the normalem but repeat the \patchmd to replace also the second \Bem. In this cas you would also have to patch the \APACrefbtitle and possibly others.

Your MWEB (minimal working example with bibliography) would then look like:

\RequirePackage{filecontents}

\begin{filecontents}{literat.bib}
@article{ferretti2001,
  title     = {Permanent Scatterers in {SAR} Interferometry},
  author    = {Alessandro Ferretti and Claudio Prati and Fabio Rocca},
  journal   = {IEEE Transactions on Geoscience and Remote Sensing},
  number    = {1},
  volume    = {39},
  pages     = {8--20},
  year      = {2001},
  publisher = {IEEE-INST Electrical Electronics Engineers Inc},
  doi       = {10.1109/36.898661},
}
@book{pye2010trashculture,
  author    = {Doe, John},
  publisher = {Book Company},
  series    = {Cultural Interactions},
  title     = {Cultures of {A}mazons},
  year      = {2015},
}
\end{filecontents}

\documentclass[12pt]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[main=turkish,english,shorthands=:!]{babel}
\usepackage[a4paper,left=30mm,top=30mm,right=25mm,bottom=25mm]{geometry}
\usepackage[normalem]{ulem}
\usepackage{etoolbox}

% BIBLIOGRAPHY
\usepackage{apacite}
\usepackage{natbib}

\AtBeginDocument{
\bibliographystyle{apacite}
\patchcmd{\APACjournalVolNumPages}{\Bem}{\uline}{\typeout{**patch success**}}{\typeout{**patch failed**}}
\patchcmd{\APACjournalVolNumPages}{\Bem}{\textnormal}{\typeout{**patch2 success**}}{\typeout{**patch2 failed**}}
\patchcmd{\APACrefbtitle}{\Bem}{\textnormal}{\typeout{**patch3 success**}}{\typeout{**patch3 failed**}}
\renewcommand{\BBAA}{ve}
\renewcommand{\BOthers}{vd}
% Removing parentheses around year in bibliography
\renewcommand{\BBOP}{}
\renewcommand{\BBCP}{}
\renewcommand{\BCBL}{}
\renewcommand{\BCBL}{}
\urlstyle{APACsame}
% Adding ":" character before page number in citations
\bibpunct[: ]{(}{)}{:}{a}{,}{~}
% Bibliography line spacing
\setlength{\bibsep}{1\itemsep}
}
\usepackage[unicode]{hyperref} %son yükle

\begin{document}
\chapter{GİRİŞ}
\citep{ferretti2001}, \citep{pye2010trashculture}
 Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
\renewcommand*\bibname{KAYNAKLAR}
\bibliography{literat}
\end{document}

By the way, underlining is an ugly bad habit inherited from typewriter's age, and if it's not mandatory, avoid it !

  • Off-topic : in bib files the pure numbers like for year or volume are normally written without braces, e.g. year=2001, – Jhor Jul 26 '18 at 12:02
  • I read a title tex.stackexchange.com/questions/286297/… Is the problem have an another answer here? The codes at this level are far above my knowledge (: – volkan Jul 26 '18 at 12:45
  • This reference deals on modifying the .bst file. This is actually much lore involved, and should be avoided as long as possible. The apacite package (.sty) and style (.bst) that you use make such stuff unnecessary, as the formatting in the bbl is not hard coded but deferred to LaTeX thanks to the commands \APACjournalVolNumPages ,BC** and siblings. It is hence enough to be able to slightly modify them with \patchcmd, or if needed to \renewcommand them in a similar way as the latex code provided by Guho in the accepted answer of this reference. – Jhor Jul 26 '18 at 13:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.